﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using US.Entity;
using US.Business;
using US.Utilities;
using System.Diagnostics;
using US.Entity.CommonModule;

namespace US.WebApp.Areas.CommonModule.Controllers
{
    /// <summary>
    /// 出口报关资料维护控制器
    /// </summary>
    public class BmsExportController : PublicController<Bms_Export>
    {

        Bms_ExportBll bms_ExportBll = new Bms_ExportBll();

        /// <summary>
        /// 分页获取出口报关单
        /// </summary>
        /// <param name="StartTime">开始时间</param>
        /// <param name="EndTime">结束时间</param>
        /// <param name="ParameterJson">查询参数</param>
        /// <param name="jqgridparam">分页参数</param>
        /// <returns></returns>
        //public JsonResult GridListPageJson(Bms_ExportDTO paramData, JqGridParam jqgridparam)
        public JsonResult GridListPageJson(string StartTime, string EndTime, string ParameterJson, JqGridParam jqgridparam)
        {
            Stopwatch watch = CommonHelper.TimerStart();
            //List<Bms_Export> ListData = bms_ExportBll.GridListJson(paramData, ref jqgridparam);
            List<Bms_Export> ListData = bms_ExportBll.GridListJson(StartTime, EndTime, ParameterJson, ref jqgridparam);
            var JsonData = new
            {
                total = jqgridparam.total,
                page = jqgridparam.page,
                records = jqgridparam.records,
                costtime = CommonHelper.TimerEnd(watch),
                rows = ListData,
            };
            return Json(JsonData, JsonRequestBehavior.AllowGet);
        }

    }
}
